package com.imooc.mapping.course4;

import com.imooc.mapping.course4.copier.MetadataCopier;
import com.imooc.module.collect.enums.DataTypeEnum;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;

/**
 * @Author Tim
 * @Description:
 * @Version 1.0
 */
public class MainTest {

    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();
        map.put("ruleId", "456");
        map.put("en", "111");
        map.put("price","123");
        Metadata mdmodel = MetadataCopier.INSTANCE.metadataCopier(map);
        System.out.println(mdmodel);

        Map<Long,String> map2 = new HashMap<>();
        map2.put(35L, "2025/11/12 11:13:45");
        map2.put(45L, "2025/12/12 12:13:45");
        Map<String, Date> stringLocalDateTimeMap = MetadataCopier.INSTANCE.longString2StringString(map2);
        System.out.println(stringLocalDateTimeMap);

        Set<String> strings = new HashSet<>();
        strings.add("456");
        strings.add("66");
        strings.add("46");
        Set<Integer> integers = MetadataCopier.INSTANCE.string2IntegerSet(strings);
        System.out.println(integers);

        List<Metadata> metadatas = new ArrayList<>();
        Metadata metadata = new Metadata();
        metadata.setId(11L);
        metadata.setPrice("456");
        metadata.setRuleId(345L);
        metadata.setEnName(678);

        metadatas.add(metadata);


        //注意浅拷贝和深拷贝
        List<Metadata> copy = MetadataCopier.INSTANCE.copyList(metadatas);
        System.out.println(copy);

        copy.get(0).setEnName(999);

        System.out.println(metadatas);
    }
}
